package net.dengzixu.java.homework.period8;

import java.util.Scanner;

/**
 * @author Deng Zixu <admin@dengzixu.com>
 */
public class Period8Homework1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        System.out.print("请输入一个整数: ");

        int inputNumber = scanner.nextInt();
        int tempNumber = inputNumber;

        for (int i = 2; i <= inputNumber / 2; i++) {
            do {
                if (tempNumber % i == 0) {
                    System.out.print(i + "、 ");
                    tempNumber /= i;
                } else {
                    break;
                }
            } while (tempNumber != 0);
        }

        // 删除最后一个 、
        System.out.print("\b\b");
    }
}
